package com.chujian.system.sys.service;


import com.chujian.framework.core.base.BaseService;
import com.chujian.framework.echo.IEchoDataService;
import com.chujian.sys.entity.SysUser;
import com.chujian.sys.vo.SysUserSourceVo;

import java.util.List;

/**
 * 人员表 服务类
 *
 * @author yj
 * @since 2021-07-28
 */
public interface SysUserService extends BaseService<SysUser>, IEchoDataService<String> {

    /**
     * 通过用户账号，获取用户列表
     *
     * @param account
     * @return
     */
    List<SysUser> listByUserAccount(String account);

    SysUser getPureUserById(Long userId);

    List<SysUser> getUsersByDeptId(Long deptId);

    void resetPassword(Long userId);

    /**
     * 获取用户基本信息
     *
     * @param sysUser
     * @return
     */
    SysUser getSimpleUserInfo(SysUser sysUser);

    SysUser getUserWithWxInfo(Long userId);

    /**
     * 清除用户上的微信相关信息
     *
     * @param userId
     */
    void clearUserWxInfos(Long userId);

    SysUser getByAccount(String loginName);

    /**
     * 检测账号是否存在
     *
     * @param loginName
     * @return
     */
    boolean checkExistAccount(String loginName);

    /**
     * 同步保存
     *
     * @param sourceVo
     * @return
     */
    SysUser saveSync(SysUserSourceVo sourceVo);

    SysUser getBySourceId(String sourceId);

    SysUser getBySourceIdWithLock(String sourceId);
}
